#!/bin/bash
echo "Creating Recovery Folder"
cd /media/vtape
mkdir recovery
chmod -R 777 recovery/
/etc/init.d/tapemgr stop
read -p "Press any key to rewind the tape"
echo "Tape rewinding. Please Wait"
mt -f /dev/nst0 rewind
read -p "Press any key to begin Manual Recovery"
echo "This program will run continuously and does not know when to end. Hit Ctrl-C to end once you see 'This does not look like a tar archive' more than 3 times in a row. Once you hit Ctrl-C, type   finish    and hit enter."
read -p "Press any key to continue if you understand these instructions."
while [ 1 ]; do tar xvf /dev/nst0 -b 300 -C /media/vtape/recovery; done





"Finish" Script

#!/bin/bash
echo "Tape rewinding. Please wait."
mt -f /dev/nst0 rewind
echo "Restarting Tape Manager"
/etc/init.d/tapemgr start
read -p "Your Tape Recovery Procedure is now complete. Please check your Cache-A share for the recovery folder and its contents. Press any key to exit."
exit 0
